<?php 
# 文件名称:login.view.php
class LoginView extends C_view
{
	function LoginView()
	{
		parent::C_view();
	}
	//加载模板
	function display($tpl)
	{		
		$SYS =& get_instance();
		$this->assignRef('message', $SYS->loader->getMessageQueue());
		$langs = $SYS->lang->languagelist(2);
		
		$js_content="
			if(window.parent.frames.length>0)
				window.parent.frames.location.href='".WEBSELF."/login';
			function check_main_login()
			{
				var m=document.login;
				if(m.login_name.value.length=='')
				{
					alert('".C_text::_('UsernameEmpty')."');
					m.login_name.focus();
					return false;
				}
				if(m.login_pass.value.length=='')
				{
					alert('".C_text::_('PasswordEmpty')."');
					m.login_pass.focus();
					return false;
				}"
		;
		if (extension_loaded('gd'))
			$js_content.="				
				if(m.security_code.value.length=='')
				{
					alert('".C_text::_('CodeEmpty')."');
					m.security_code.focus();
					return false;
				}"
		;
		$js_content.="
				m.submit();
			}
		";
		$SYS->doc->addScriptDeclaration($js_content);
		$SYS->html->script('core.js');
		C_html::stylesheet('login.css',WEBURL.'/templates/'.$SYS->config->item('theme').'/css/');
		$this->assignRef( 'langs', $langs);
		$this->assign( 'title', C_text::_('KnifeCMS').' '.C_text::_('Login' ));
		parent::display('login');
	}
}
?>